home *** CD-ROM | disk | FTP | other *** search
- Path: koobera.math.uic.edu!djb
- From: djb@koobera.math.uic.edu (D. J. Bernstein)
- Message-ID: <1996Feb2718.30.22.8951@koobera.math.uic.edu>
- Date: 27 Feb 1996 18:30:22 GMT
- Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
- Subject: Re: Access carry flag from C
- References: <Dn1C9z.DGv.0.net@indra.com> <4gihtk$33k@sun001.spd.dsccc.com> <1996Feb2300.56.01.15905@koobera.math.uic.edu> <3132f48b.33181161@netline-fddi.jpl.nasa.gov>
- Organization: IR
-
- Kevin Quitt <kdq@emoryi.jpl.nasa.gov> wrote:
- > djb@koobera.math.uic.edu (D. J. Bernstein) wrote:
- > > The correctness of ``if (i < j)'' as an overflow test is guaranteed by
- > > the ANSI C definition of unsigned arithmetic, which happens to match
- > > what every existing compiler does.
- > Given that the overflow causes undefined behaviour,
-
- It doesn't. Unsigned overflow is perfectly well defined.
-
- ---Dan
-